<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
	function changeSchool() {
		var id = $("#student-register-select option:selected").val();
		var val = $("#" + id + "carTypeVal").val();
		var valA = val.split(" ");
		var html = "";
		for (var i = 1; i < valA.length; i++) {
			html += "<option value='"+valA[i]+"'>" + valA[i] + "</option>";
		}
		$("#carType-option").html(html);
	}
	$(function() {
		changeSchool();
	});
</script>
<p>
	<label>所属驾校*</label><select name="sid" class="form-control "
		id="student-register-select" onchange="javascript:changeSchool()">
		<c:forEach items="${schools }" var="s">
			<option value="${s.id }">${s.name }</option>
		</c:forEach>
	</select>
</p>
<c:forEach items="${schools }" var="s">
	<input type="hidden" value="${s.carTypes }" id="${s.id }carTypeVal" />
</c:forEach>
<label>报考车型*</label>
<div>
	<select name="carType" class="form-control " id="carType-option">

	</select>
</div>

<script src="<%=request.getContextPath()%>/resources/MyJs/modal.js"></script>
<link
	href='<%=request.getContextPath()%>/resources/css/datetimepicker.css'
	rel='stylesheet'>
<script
	src="<%=request.getContextPath()%>/resources/js/jquery.datetimepicker.js"></script>